from DebugLogger import *
from globalconstants import *
from globalstates import *


class AccidentBase(object):
    def __init__(self):
        self.description = "Accident Base Class - not intended for usage"    
        self.reactor_index = -1
        self.increased_radiation = -1    
    def perform(self):
        DebugLogger.DebugOut("- perform accident: " + self.description )
    
class Accident0(AccidentBase):
    def __init__(self):
        self.accident = ACCIDENT_BROKEN_PIPES_INNER_COOLING_SYSTEM
        self.description = "Some pipes of the inner cooling system got broken."
        self.increased_radiation = -1
    def perform(self):
        AccidentBase.perform(self)
        GlobalStates.IncreaseRadiationLevel(7) 
        
class Accident1(AccidentBase):
    def __init__(self):
        self.accident = ACCIDENT_REACTOR_OUTER_CORE_EXPLOSION
        self.description = "An outer reactor exploded."
        self.increased_radiation = -1  
    def perform(self):
        AccidentBase.perform(self)
        GlobalStates.IncreaseRadiationLevel(25)
        
class Accident2(AccidentBase):
    def __init__(self):
        self.accident = ACCIDENT_REACTOR_FRACTURE
        self.description = "A reactor core got a fracture."
        self.increased_radiation = -1
    def perform(self):
        AccidentBase.perform(self)
        GlobalStates.IncreaseRadiationLevel(51)
        
class Accident3(AccidentBase):
    def __init__(self):
        self.accident = ACCIDENT_PARTIAL_MELTDOWN
        self.description = "A reactor core is in partial meltdown."
        self.increased_radiation = -1
    def perform(self):
        AccidentBase.perform(self)
        GlobalStates.IncreaseRadiationLevel(102)
        
class Accident4(AccidentBase):
    def __init__(self):
        self.accident = ACCIDENT_FULL_MELTDOWN
        self.description = "A reactor core is in full meltdown."
        self.increased_radiation = -1     
    def perform(self):
        AccidentBase.perform(self)
        GlobalStates.IncreaseRadiationLevel(515)
        
class Accident5(AccidentBase):
    def __init__(self):
        self.accident = ACCIDENT_REACTOR_INNER_CORE_EXPLOSION
        self.description = "There has been a huge explosion in one of the inner reactor cores, releasing large radiation quantities into the athmosphere."
        self.increased_radiation = -1
    def perform(self):
        AccidentBase.perform(self)
        GlobalStates.IncreaseRadiationLevel(1158)                
